package com.woniuxy.gateway;

import com.woniuxy.sddfp.common.utils.JwtTemplate;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.gateway.filter.WeightCalculatorWebFilter;
import org.springframework.cloud.gateway.filter.factory.PrefixPathGatewayFilterFactory;
import org.springframework.cloud.gateway.filter.factory.StripPrefixGatewayFilterFactory;
import org.springframework.cloud.gateway.handler.predicate.PathRoutePredicateFactory;
import org.springframework.cloud.gateway.handler.predicate.WeightRoutePredicateFactory;
import org.springframework.context.annotation.Bean;

/**
 * @author yellow Doctor
 * @date 2025-06-27
 * @desc 蜗牛创想：www.woniuxy.com
 */
@SpringBootApplication
public class GatewayApplication {

    //权重的 决策方式 实现
    WeightCalculatorWebFilter weightCalculatorWebFilter;
    //这里是 权重的 断言类
    WeightRoutePredicateFactory weightRoutePredicateFactory;

    //断言
    PathRoutePredicateFactory pathRoutePredicateFactory;

    //截取操作
    StripPrefixGatewayFilterFactory StripPrefixGatewayFilterFactory;

    public static void main(String[] args) {
        SpringApplication.run(GatewayApplication.class, args);
    }

    @Bean
    public JwtTemplate jwtTemplate(){
        return new JwtTemplate();
    }
}
